package com.df.bpm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.df.common.service.impl.BaseServiceImpl;
import com.df.bpm.dto.BusinessInformationDTO4Subset;
import com.df.bpm.mapper.BusinessInformationDTO4SubsetMapper;
import com.df.bpm.service.BusinessInformationDTO4SubsetService;

import com.df.common.utils.CommonUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class BusinessInformationDTO4SubsetServiceImpl extends BaseServiceImpl<BusinessInformationDTO4SubsetMapper,BusinessInformationDTO4Subset> implements BusinessInformationDTO4SubsetService {
	public final BusinessInformationDTO4SubsetMapper businessInformationDTO4SubsetMapper;

	public List<BusinessInformationDTO4Subset> getSteps(Integer groupID, Integer superior){
		if(CommonUtils.varIsBlank(groupID)){
			QueryWrapper<BusinessInformationDTO4Subset> wrapper=new QueryWrapper<>();
			wrapper.eq("superior", superior)
					.orderByAsc("groupID")
					.orderByAsc("sequence")
					.orderByAsc("entityID")
					.orderByAsc("businessDesc");
			return businessInformationDTO4SubsetMapper.selectList(wrapper);
		}
		return businessInformationDTO4SubsetMapper.getSteps(groupID,superior);
	}
}